import MonoSingle from "../Utility/MonoSingle";

const { ccclass, property } = cc._decorator;

@ccclass
export default class GuideEvent extends cc.Component {

    private mainStateTvBoxGuide: boolean;

    @property(cc.Node)
    public node_guide = null;
    protected onLoad(): void {
    }

    start() {
        var self = this;
        this.scheduleOnce(function () {
            // cc.sys.localStorage.clear();
            self.mainStateTvBoxGuide = cc.sys.localStorage.getItem("MainStateTvBoxGuide");
            cc.error("新手引导::" + !self.mainStateTvBoxGuide);
            if (self.mainStateTvBoxGuide)
                self.mainStateTvBoxGuide = cc.sys.localStorage.getItem("MainStateTvBoxGuide");
            else {
                cc.sys.localStorage.setItem("MainStateTvBoxGuide", true);
                self.mainStateTvBoxGuide = cc.sys.localStorage.getItem("MainStateTvBoxGuide");
                self.node_guide.active = true;
                // MonoSingle.GetTvBoxInput().pushSavePrePanelTop(self.node)
                // MonoSingle.GetTvBoxInput().initTvBoxCurPanelEvent(0.2, self.node, this)
            }
        }, 0.2);
    }

    backInputAction(): void {
        this.node_guide.active = false;
        // MonoSingle.GetTvBoxInput().popSavePrePanelTop()
        // MonoSingle.GetTvBoxInput().initTvBoxCurPanelEvent(0, MonoSingle.GetTvBoxInput().getSavePrePanelTop())
    }
}
